﻿using System.Diagnostics.Contracts;
using System.Linq.Expressions;
using System.Reactive.Concurrency;

namespace System.Reactive.Linq
{
	public static partial class Qbservable
	{
		public static IQbservable<TResult> If<TResult>(this IQbservableProvider provider, Expression<Func<bool>> condition, IObservable<TResult> thenSource)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(condition != null, null, "condition != null");
			Contract.Requires(thenSource != null, null, "thenSource != null");
			Contract.Ensures(Contract.Result<IQbservable<TResult>>() != null, null, "Contract.Result<IQbservable<TResult>>() != null");
			return null;
		}

		public static IQbservable<TResult> If<TResult>(this IQbservableProvider provider, Expression<Func<bool>> condition, IObservable<TResult> thenSource, IObservable<TResult> elseSource)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(condition != null, null, "condition != null");
			Contract.Requires(thenSource != null, null, "thenSource != null");
			Contract.Requires(elseSource != null, null, "elseSource != null");
			Contract.Ensures(Contract.Result<IQbservable<TResult>>() != null, null, "Contract.Result<IQbservable<TResult>>() != null");
			return null;
		}

		public static IQbservable<TResult> If<TResult>(this IQbservableProvider provider, Expression<Func<bool>> condition, IObservable<TResult> thenSource, IScheduler scheduler)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(condition != null, null, "condition != null");
			Contract.Requires(thenSource != null, null, "thenSource != null");
			Contract.Requires(scheduler != null, null, "scheduler != null");
			Contract.Ensures(Contract.Result<IQbservable<TResult>>() != null, null, "Contract.Result<IQbservable<TResult>>() != null");
			return null;
		}

		public static IQbservable<TSource> IgnoreElements<TSource>(this IQbservable<TSource> source)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Ensures(Contract.Result<IQbservable<TSource>>() != null, null, "Contract.Result<IQbservable<TSource>>() != null");
			return null;
		}

		public static IQbservable<long> Interval(this IQbservableProvider provider, TimeSpan period)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Ensures(Contract.Result<IQbservable<long>>() != null, null, "Contract.Result<IQbservable<long>>() != null");
			return null;
		}

		public static IQbservable<long> Interval(this IQbservableProvider provider, TimeSpan period, IScheduler scheduler)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(scheduler != null, null, "scheduler != null");
			Contract.Ensures(Contract.Result<IQbservable<long>>() != null, null, "Contract.Result<IQbservable<long>>() != null");
			return null;
		}

		public static IQbservable<bool> IsEmpty<TSource>(this IQbservable<TSource> source)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Ensures(Contract.Result<IQbservable<bool>>() != null, null, "Contract.Result<IQbservable<bool>>() != null");
			return null;
		}
	}
}